/**
 * Project Name:fire-industry-DM-center
 * File Name:User.java
 * Package Name:com.firestone.bean.user
 * Date:2018年3月22日上午10:20:59
 *
*/

package com.firestone.bean.dto.user;

import java.util.Collection;
import java.util.List;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * @Description: TODO(用户bean)
 * @author CAIYJ
 * @date 2018年3月22日 上午10:20:59
 */
public class User implements UserDetails{
    
    private static final long serialVersionUID = 1L;

    private Long id; 
    
    private String username;
    
    private String password;

    private List<? extends GrantedAuthority> authorities;
    
    public User() {
        super();
    }

    public User(Long id, String username, String password) {
        super();
        this.id = id;
        this.username = username;
        this.password = password;
    }

    @Override
    public boolean isAccountNonExpired() {
        
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        
        return true;
    }

    @Override
    public boolean isEnabled() {
        
        return true;
    }
    
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setAuthorities(List<? extends GrantedAuthority> authorities) {
        this.authorities = authorities;
    }

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return authorities;
    }

   
}

